home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / pmlsrc23.zoo / pmlsrc / max.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-19  |  1.4 KB  |  71 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20.  
  21. /*
  22.  *  FUNCTION
  23.  *
  24.  *    max   double precision maximum of two arguments
  25.  *
  26.  *  KEY WORDS
  27.  *
  28.  *    max
  29.  *    machine independent routines
  30.  *    math libraries
  31.  *
  32.  *  DESCRIPTION
  33.  *
  34.  *    Returns maximum value of two double precision numbers.
  35.  *
  36.  *  USAGE
  37.  *
  38.  *    double max (x,y)
  39.  *    double x;
  40.  *    double y;
  41.  *
  42.  *  PROGRAMMER
  43.  *
  44.  *    Fred Fish
  45.  *    Tempe, Az 85281
  46.  *
  47.  */
  48.  
  49. #include <stdio.h>
  50. #include <math.h>
  51. #include "pml.h"
  52.  
  53.  
  54. #ifdef max    /* keep the function version in the lib too */
  55. #undef max
  56. #endif
  57.  
  58. double max (x, y)
  59. double x;
  60. double y;
  61. {
  62.     ENTER ("max");
  63.     DEBUG4 ("maxin", "x = %le  y = %le", x, y);
  64.     if (x < y) {
  65.     x = y;
  66.     }
  67.     DEBUG3 ("maxout", "result %le", x);
  68.     LEAVE ();
  69.     return (x);
  70. }
  71.